import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import * as api from './api/requests.js'
import { Button, Tab, Tabs, Swipe, SwipeItem, Tabbar, TabbarItem, Icon, Sticky, Sidebar, SidebarItem, Lazyload, Search, NavBar, GoodsAction, GoodsActionIcon, GoodsActionButton, Popup, Toast, Overlay, Loading, Form, Field, CountDown, Notify, NoticeBar, AddressEdit, Dialog, RadioGroup, Radio, Uploader, PullRefresh } from 'vant'

// 引入全局组件
import FooterTab from './components/footer'
import More from './components/more'
import Spa from './components/spa/index.vue'
import Num from './components/num/index.vue'
import backTitle from './components/backandtitle/index.vue'
import OrderItem from './components/orderItem/index.vue'
import OrderList from './components/orderItem/orderList.vue'
import noList from './components/noList'

import 'amfe-flexible'

Vue.use(PullRefresh)

Vue.use(Uploader)

Vue.use(Radio)
Vue.use(RadioGroup)

Vue.use(Dialog)

Vue.use(AddressEdit)

Vue.use(NoticeBar)

// 全局注册
Vue.use(Notify)

Vue.use(CountDown)

Vue.use(Form)
Vue.use(Field)

Vue.use(Loading)

Vue.use(Overlay)

Vue.use(Toast)

Vue.use(Popup)

Vue.use(GoodsAction)
Vue.use(GoodsActionButton)
Vue.use(GoodsActionIcon)

Vue.use(NavBar)

Vue.use(Search)

Vue.use(Lazyload)
Vue.use(Sidebar)
Vue.use(SidebarItem)
Vue.use(Sticky)
Vue.use(Icon)
Vue.use(Tabbar)
Vue.use(TabbarItem)
// 注册公共组件
Vue.component(FooterTab.name, FooterTab)
Vue.component(More.name, More)
Vue.component(Spa.name, Spa)
Vue.component(Num.name, Num)
Vue.component(backTitle.name, backTitle)
Vue.component(OrderItem.name, OrderItem)
Vue.component(OrderList.name, OrderList)
Vue.component(noList.name, noList)

Vue.use(Swipe)
Vue.use(SwipeItem)
Vue.use(Tab)
Vue.use(Tabs)

Vue.config.productionTip = false
Vue.use(Button)

new Vue({
  router,
  store,
  render: h => h(App),
  beforeCreate() {
    Vue.prototype.$API = api
  }
}).$mount('#app')
